﻿using Caliburn.Micro;
using SD.Infrastructure.WPF.Caliburn.Aspects;
using SD.Infrastructure.WPF.Caliburn.Base;
using SlamDunk.MES.IAppService.Interfaces;
using SlamDunk.MES.Presentation.Models.NotifyModels;
using System.Collections.ObjectModel;
using System.ServiceModel.Extensions;
using System.Threading.Tasks;

namespace SlamDunk.MES.Client.ViewModels.Report
{
    /// <summary>
    /// 成品质检统计明细ViewModel
    /// </summary>
    public class ExecutionPlanInspectionDetailReportViewModel : ScreenBase
    {
        #region # 字段及构造器
        /// <summary>
        /// 质量管理服务契约接口代理
        /// </summary>
        private readonly ServiceProxy<IQualityContract> _iQualityContract;

        /// <summary>
        /// 窗口管理器
        /// </summary>
        private readonly IWindowManager _windowManager;

        /// <summary>
        /// 依赖注入构造器
        /// </summary>
        public ExecutionPlanInspectionDetailReportViewModel(ServiceProxy<IQualityContract> iQualityContract, IWindowManager windowManager)
        {
            this._iQualityContract = iQualityContract;
            this._windowManager = windowManager;
        }
        #endregion

        #region # 属性
        #region 获取作业计划质量检查列表 —— ObservableCollection<Wrap<ExecutionPlanInspectionDetailReportInfo>> ExecutionPlanInspectionDetailReports
        /// <summary>
        /// 获取作业计划质量检查列表
        /// </summary>
        [DependencyProperty]
        public ObservableCollection<ExecutionPlanInspectionSummaryDetailNm> ExecutionPlanInspectionDetailReports { get; set; }
        #endregion
        #endregion

        #region # 方法
        //Initializations
        #region 加载 —— async Task Load(ProductionPlanReportInfo _productionPlanReportInfo)
        /// <summary>
        /// 加载
        /// </summary>
        public async Task Load(ExecutionPlanInspectionSummaryNm executionPlanInspectionSummaryNm)
        {
            ExecutionPlanInspectionDetailReports = new ObservableCollection<ExecutionPlanInspectionSummaryDetailNm>();
            ExecutionPlanInspectionDetailReports = executionPlanInspectionSummaryNm.ExecutionPlanInspectionDetailReports;
        }
        #endregion
        #endregion
    }
}
